from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait


def get_movie():
    browser = webdriver.Chrome()
    try:
        detail_list=[]
        browser.get("http://www.iqiyi.com/dianying_new/i_list_paihangbang.html")
        wait = WebDriverWait(browser,10)
        wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR,'.piclist-scroll')))
        detail_imgs = browser.find_elements_by_xpath('//div[@class="site-piclist_pic"] / a / img')
        for img in detail_imgs:
            detail_list.append(img.get_attribute('src'))
        print(detail_list)
    finally:
        browser.close()


if __name__ == "__main__":
    get_movie()